import Vue from 'vue'
import VueI18n from 'vue-i18n'
import enLocale from './en'
import zhLocale from './zh'
import zhElement from './element_zh'
import enElement from './element_en'

Vue.use(VueI18n);


const messages = {
  en: {
    ...enLocale,
    ...enElement
  },
  zh: {
    ...zhLocale,
    ...zhElement
  }
}

const i18n = new VueI18n({
  locale: localStorage.getItem('language') || 'zh', // set locale
  messages // set locale messages
})

export default i18n
